//package com.liu.yubi.bimq;
//
//import com.rabbitmq.client.Channel;
//import com.rabbitmq.client.Connection;
//import com.rabbitmq.client.ConnectionFactory;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Value;
//
//import static com.liu.yubi.constant.BiCommonConstant.*;
//
//
///**
// * @author lqh
// * @since 2025-06-13 15:17
// * 用于创建队列和交换机（只启动一次）
// */
//@Slf4j
//public class MqInitMain {
//    @Value ("${spring.rabbitmq.host}")
//     static String MQ_HOST;
//
//    public static void main(String[] args)  {
//        ConnectionFactory factory = new ConnectionFactory ();
//        factory.setHost (MQ_HOST);
//        try (Connection connection = factory.newConnection ();
//             Channel channel = connection.createChannel ()){
//            //声明一个交换机
//            channel.exchangeDeclare (BI_EXCHANGE_NAME,"direct");
//            //声明一个队列
//            channel.queueDeclare (BI_QUEUE_NAME,true,false,false,null);
//            //绑定
//            channel.queueBind (BI_QUEUE_NAME, BI_EXCHANGE_NAME, BI_ROUTING_KEY);
//        }catch (Exception e) {
//            log.error (e.getMessage ());
//        }
//    }
//}
